//
//  GWStatuseReportView.m
//  新浪微博
//
//  Created by qianfeng on 16/2/18.
//  Copyright (c) 2016年 高炜. All rights reserved.
//

#import "GWStatuseReportView.h"
#import "GWReportStatuseFrame.h"
#import "GWStatuseModel.h"
#import "GWStatusePhotosView.h"
#import "GWStatuseLabel.h"
#import "GWReportStatuseToolBar.h"
@interface GWStatuseReportView()
/**昵称*/
//@property (nonatomic,weak)UILabel *nameLabel;
/**正文*/
@property (nonatomic,weak)GWStatuseLabel *textLabel;
/**相册*/
@property (nonatomic,weak)GWStatusePhotosView *photosView;
/**toolbar*/
@property (nonatomic,weak)GWReportStatuseToolBar
*toolBar;
@end
@implementation GWStatuseReportView

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self =[super initWithFrame:frame]) {
        self.userInteractionEnabled =YES;
        //昵称
//        UILabel *namelabel =[[UILabel alloc]init];
//        [self addSubview:namelabel];
//        self.nameLabel =namelabel;
//        namelabel.textColor =GWStatusHighTextColor;
//        namelabel.font =ReportStatuseNameFont;
        //正文
        GWStatuseLabel *textLabel =[[GWStatuseLabel alloc]init];
        [self addSubview:textLabel];
        self.textLabel =textLabel;
        
        //相册
        GWStatusePhotosView *photosView =[[GWStatusePhotosView alloc]init];
        [self addSubview:photosView];
        self.photosView =photosView;
        
        GWReportStatuseToolBar *toolBar =[[GWReportStatuseToolBar alloc]init];
        [self addSubview:toolBar];
        self.toolBar =toolBar;
        self.image =[UIImage reSizeWithName:@"timeline_retweet_background"];
        
        self.backgroundColor =[UIColor redColor];
    }
    return self;
}
-(void)setReportStatuseFrame:(GWReportStatuseFrame *)reportStatuseFrame
{
    _reportStatuseFrame =reportStatuseFrame;
    
    GWStatuseModel *statuse =reportStatuseFrame.statuse;
    
    self.frame =reportStatuseFrame.frame;
    
//    self.nameLabel.frame =reportStatuseFrame.nameLabelF;
//    self.nameLabel.text =[NSString stringWithFormat:@"@%@",statuse.user.name];
    
    self.textLabel.frame =reportStatuseFrame.textLabelF;
    self.textLabel.attributedString =statuse.attributedText;
    
    if (statuse.pic_urls.count) {
        self.photosView.hidden =NO;
        self.photosView.frame =reportStatuseFrame.photosViewF;
        self.photosView.pic_urls =reportStatuseFrame.statuse.pic_urls;
    }
    else
    {
        self.photosView.hidden =YES;
    }
    if (statuse.isDetail) {
        self.toolBar.frame =reportStatuseFrame.toolBarF;
        self.toolBar.statuse =reportStatuseFrame.statuse;
        self.toolBar.hidden =NO;
    }else
    {
        self.toolBar.hidden =YES;
    }
    
}
@end
